﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Box2D.XNA;
using Imagine;

namespace Carmack
{
    /// <summary>
    /// ///////////////////////////////////////////////////////////
    /// </summary>
    public class CBullets : GameObject
    {
        public PhysicsSprite bulletSprite;
        public Vector2 direction;
        public Vector2 force;
        public CBullets(string texture, Vector2 position)
        {
            bulletSprite = new PhysicsSprite(texture);
            bulletSprite.Friction = 0.7f;
            bulletSprite.BodyType = BodyType.Dynamic;
            bulletSprite.HotSpot = eHotSpot.eCenter;
            bulletSprite.Bullet = true;
            bulletSprite.Position = position;
        }

        public override bool Update(GameTime gt_)
        {
            bulletSprite.Update(gt_);
            return true;
        }

        public override bool Draw(GameTime gt_)
        {
            bulletSprite.Draw(gt_);
            return false;
        }

        public void Init()
        {
            bulletSprite.InitPhysics(eShapeType.Shape_Circle, id);
            bulletSprite.Body.SetUserData("bullet");
        }
    }
}
